from django.urls import path
from .views import UsersModelViewSet,QTypeModelViewSet,QuestionModelViewSet,RoleModelViewSet,MenuModelViewSet
from rest_framework.routers import DefaultRouter
from rest_framework_simplejwt.views import TokenRefreshView
from job.MyAuthority import MyTokenObtainPairView

urlpatterns = [
    # path('admin/', admin.site.urls),
    path('login', MyTokenObtainPairView.as_view()),
    path('token/refresh', TokenRefreshView.as_view()),
]

route = DefaultRouter(trailing_slash=False) # trailing_slash 去除路径后边斜杠
route.register('user',UsersModelViewSet,basename='user')
route.register('qtype',QTypeModelViewSet,basename='qtype')
route.register('question',QuestionModelViewSet,basename='question')
route.register('role',RoleModelViewSet,basename='role')
route.register('menu',MenuModelViewSet,basename='menu')
urlpatterns+=route.urls
print(urlpatterns)
